Skip to content

Conversation

@enoshixi
Copy link
Contributor

@enoshixi enoshixi commented Jan 9, 2014

My app was using a lot (100+) of selectize controls on a page and autoGrow / measureString was a significant bottleneck.

An easy fix was to have measureString avoid actually measuring when not necessary (i.e. empty string).

I also keep track of the current width of the input in the autoGrow closure to avoid having to measure the width before updating it, as that was also slowing down initialization.

In autoGrow, track the input's current width in a closure rather than
using jQuery .width() to see if the width needs updating.
brianreavis added a commit that referenced this pull request Feb 10, 2014
Updated measureString to return 0 for an empty string.
@brianreavis brianreavis merged commit 67ef826 into selectize:master Feb 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants